<?php
include 'config/config.php';
include 'lib/promo.php';
include 'lib/member.php';
include 'lib/produk.php';

$config=new config();
$config->connect();

$Promo_Dao=new Promo_Dao();
$data=$Promo_Dao->get_aktif();


?>
<?php include("header.php") ?>
<?php include("menu_kiri.php") ?>

<div id="body">
<div class="topbox">
                  Daftar Promo:
                  <br>
				  <br>
                  <table class="table">
				  <tr>
					<th>Gambar</th>
					<th>Produk</th>
					<th>Harga</th>
					<th>Ketentuan</th>
					<th>Nama Hotel</th>
					
				  </tr>
				  
				  <?php
				  $i=1;
				  foreach($data as $dt){
				  
					$Member_Dao=new Member_Dao();
					$member=$Member_Dao->get_id($dt->id);
					//echo $member->id;
					$Produk_Dao=new Produk_Dao();
					$produk=$Produk_Dao->get_id($dt->id_produk);
					$tgl_mulai = date("d-M-Y", strtotime($dt->tgl_mulai));
					$tgl_selesai = date("d-M-Y", strtotime($dt->tgl_selesai));
				  ?>
				  
				   <tr>
				    <td>
					<?php echo "<image src=\"member/images/produk/$produk->foto_produk\" width=\"120\" height=\"70\" class=\"left\">";?></td>
					<td>
					<?php 
					echo "<p><a href=\"detil_produk.php?id=$dt->id_produk\">".ucwords($produk->nama_produk)." Room</a></p>"; 
					?>
					</td>
					<td><?php 
					echo "<p><del>Rp".number_format($produk->harga, 2, '.', ',')."</del></p>";
					echo "<p>Rp".number_format($dt->harga_promo, 2, '.', ',')."</del></p>"; 
					
					?></td>
					<td>
					<?php 
					echo "<p>berlaku pada tanggal ".$tgl_mulai." s.d ".$tgl_selesai."</p>";
					echo $dt->keterangan_promo;
					?>
					<td><?php echo "<a href=\"detil_hotel.php?id=$dt->id\"><p>".ucwords($member->nama)."</p></a>"; ?></td>				
					
					
									
				  </tr>
				  <?php $i++;}?>

				  
				  </table>
				  <br/>
				  <INPUT TYPE="button" VALUE="Back" onClick="history.go(-1);">             
</div>             
</div>
          
         <div class="clear"></div>
         <?php include("footer.php") ?>
		